package cn.zn.modules.money.cur.entity;

import cn.hutool.core.util.NumberUtil;
import cn.zn.framework.common.abs.AbsOldMainEntity;
import cn.zn.modules.money.enums.MoneyTypeEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_money_info")
public class TMoneyInfo extends AbsOldMainEntity {

    @TableField(value = "CATE_CODE_")
    private String cateCode;

    @TableField(value = "MONEY_TYPE_CODE_")
    private String moneyTypeCode;

    @TableField(value = "PROJECT_CODE_")
    private String projectCode;

    @TableField(value = "TOTAL_MONEY_")
    private Double totalMoney;

    @TableField(value = "FREEZE_MONEY")
    private Double freezeMoney;

    @TableField(value = "USE_MONEY")
    private Double useMoney;

    @TableField(exist = false)
    private String projectName;

    @TableField(exist = false)
    private String cateName;

    public String getMoneyTypeName() {
        return MoneyTypeEnum.findByCode(this.getMoneyTypeCode()).getName();
    }

    /**
     * 查询条件
     */
    @TableField(exist = false)
    private String key;
}